package com.itheima.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: 宋H
 * @Date: 2022/8/19
 * @Description: com.itheima.config
 * @version: 1.0
 */
@Configuration
public class MpConfig {
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        //定义拦截器栈
        MybatisPlusInterceptor mb = new MybatisPlusInterceptor();

        //设置具体的拦截器
        mb.addInnerInterceptor(new PaginationInnerInterceptor());
        return mb;
    }
}
